package com.boarsoft.boar.batch.demo.split;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.boarsoft.flow.core.bean.ProcessHandler;
import com.boarsoft.hibernate.dao.SimpleDao;

public class TableInitPH1 implements ProcessHandler {
	private static Logger log = LoggerFactory.getLogger(TableInitPH1.class);

	@Autowired
	private SimpleDao dao;

	@Override
	public Object process(String entry, Object data, Throwable throwable) throws Throwable {
		log.info("{}", data);
		String[] args = (String[]) data;
		int total = Integer.parseInt(args[0]);
		int uid = Integer.parseInt(args[1]);
//		for (int i = 0; i < total; i++) {
//			dao.executeSql(new StringBuilder("insert into snow").append(uid)//
//					.append(" (id) values (").append(i).append(")").toString());
//		}
		return data;
	}
}
